home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / lib / include / sys / param.h < prev    next >
C/C++ Source or Header  |  1991-12-16  |  3KB  |  103 lines

  1. /*
  2.  * param.h --
  3.  *
  4.  *    This file is modelled after the UNIX include file <sys/param.h>,
  5.  *    but it only contains information that is actually used by user
  6.  *    processes running under Sprite (the UNIX file contains mostly
  7.  *    stuff for the kernel's use).  This file started off empty, and
  8.  *    will gradually accumulate definitions as the needs of user
  9.  *    processes become clearer.
  10.  *
  11.  * Copyright 1988 Regents of the University of California
  12.  * Permission to use, copy, modify, and distribute this
  13.  * software and its documentation for any purpose and without
  14.  * fee is hereby granted, provided that the above copyright
  15.  * notice appear in all copies.  The University of California
  16.  * makes no representations about the suitability of this
  17.  * software for any purpose.  It is provided "as is" without
  18.  * express or implied warranty.
  19.  *
  20.  * $Header: /sprite/src/lib/include/sys/RCS/param.h,v 1.15 91/12/16 14:02:47 rab Exp $ SPRITE (Berkeley)
  21.  */
  22.  
  23. #ifndef _SYS_PARAM_H
  24. #define _SYS_PARAM_H
  25.  
  26. #include <sys/types.h>
  27. #include <signal.h>
  28. #include <machparam.h>
  29.  
  30. #define HZ      60
  31.  
  32. /*
  33.  * MAXPATHLEN defines the longest permissable path length
  34.  * after expanding symbolic links.
  35.  */
  36. #define MAXPATHLEN      1024
  37.  
  38. /*
  39.  * MAXBSIZE defines the largest block size stored in the file system.
  40.  */
  41. #define MAXBSIZE    4096
  42.  
  43. /*
  44.  * The macro below converts from the "st_blocks" field of a "struct stat"
  45.  * to the number of bytes allocated to a file.  The "st_blocks" field
  46.  * is currently measured in (archaic) 512-byte units.
  47.  */
  48. #define dbtob(blocks) ((unsigned) (blocks) << 9)
  49.  
  50. /*
  51.  * MAXHOSTNAMELEN defines the maximum length of a host name in the
  52.  * network.
  53.  */
  54. #define MAXHOSTNAMELEN 64
  55.  
  56. /*
  57.  * Maximum number of characters in the argument list for exec.  Is this
  58.  * really a limit in Sprite, or is it here just for backward compatibility?
  59.  */
  60. #define NCARGS 10240
  61.  
  62. /*
  63.  * Maximum number of open files per process.  This is not really a limit
  64.  * for Sprite;  it's merely there for old UNIX programs that expect it.
  65.  */
  66. #define NOFILE 64
  67.  
  68. /*
  69.  * The maximum number of groups that a process can be in at once
  70.  * (the most stuff ever returned by getgroups).  Note:  this needs
  71.  * to be coordinated with FS_NUM_GROUPS, which it isn't right now.
  72.  */
  73. #define NGROUPS 16
  74.  
  75. /*
  76.  * Macros for fast min/max.
  77.  */
  78. #define MIN(a,b) (((a)<(b))?(a):(b))
  79. #define MAX(a,b) (((a)>(b))?(a):(b))
  80.  
  81. /*
  82.  * Round up an object of size x to one that's an integral multiple
  83.  * of size y.
  84.  */
  85.  
  86. #define roundup(x, y)    ((((x) + ((y) -1))/(y))*(y))
  87.  
  88. /*
  89.  * Miscellanous.
  90.  */
  91. #ifndef NULL
  92. #define NULL    0
  93. #endif /* NULL */
  94.  
  95. /*
  96.  * Scale factor for scaled integers used to count
  97.  * %cpu time and load averages.
  98.  */
  99. #define FSHIFT  8               /* bits to right of fixed binary point */
  100. #define FSCALE  (1<<FSHIFT)
  101.  
  102. #endif /* _SYS_PARAM_H */
  103.